package com.wxd.framework.vo;

import java.util.List;

import com.wxd.framework.entity.Menu;
import com.wxd.framework.entity.Role;

public class TreeItem {
	
	public TreeItem(Menu menu){
		this.id = menu.getId();
		this.text = menu.getMenuName();
		this.icon = menu.getIcon();
		this.url = menu.getUrl();
		this.state = menu.getIsLast()?"open":"closed";
		this.checked = false;
	}
	
	public TreeItem(Role role){
		this.id = role.getId();
		this.text = role.getRoleName();
		this.checked = false;
	}
	
	private String id;
	private String text;
	private String icon;
	private String url;
	private String state;
	private Boolean checked;
	private List<TreeItem> children;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public Boolean getChecked() {
		return checked;
	}
	public void setChecked(Boolean checked) {
		this.checked = checked;
	}
	public List<TreeItem> getChildren() {
		return children;
	}
	public void setChildren(List<TreeItem> children) {
		this.children = children;
	}

	
}
